package org.chnxi.study.springcloud.dubbo.storage.controller;

import org.dromara.soul.client.springcloud.annotation.SoulSpringCloudClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Time;
import java.util.concurrent.TimeUnit;

@RestController
@SoulSpringCloudClient(path = "/storage")
public class StorageController {

    @GetMapping("/storage/test")
    @SoulSpringCloudClient(path = "/test", desc = "spring cloud 测试")
    public String test(){
        try {
            TimeUnit.MILLISECONDS.sleep(400);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        if(System.currentTimeMillis()%2==0){
            throw new RuntimeException("MyException");
        }
        return "ok-8002";
    }

}
